[all:vars]
ansible_user=student{{ item }}
ansible_ssh_pass={{ admin_password }}
{% if ssh_port is defined %}
ansible_port={{ ssh_port }}
{% endif %}

[control]
{% for vm in ansible_node_facts.instances %}
{% if 'student' + item == vm.tags.Student %}
ansible ansible_host={{ vm.public_ip_address }} private_ip={{ hostvars[vm.tags.Name]['private_ip'] }}
{% endif %}
{% endfor %}

[attack]
{% for vm in attacker_node_facts.instances %}
{% if 'student' + item == vm.tags.Student %}
attacker ansible_host={{ vm.public_ip_address }} ansible_user={{ vm.tags.username }} private_ip={{ hostvars[vm.tags.Name]['private_ip'] }} private_ip2={{ hostvars[vm.tags.Name]['private_ip2'] }}
{% endif %}
{% endfor %}

[siem]
{% if security_console == 'splunk' %}
{% for vm in splunk_node_facts.instances %}
{% if 'student' + item == vm.tags.Student %}
splunk ansible_host={{ vm.public_ip_address }} ansible_user=admin private_ip={{ hostvars[vm.tags.Name]['private_ip'] }} ansible_httpapi_pass="Ansible1!" ansible_connection=httpapi ansible_httpapi_use_ssl=yes ansible_httpapi_validate_certs=False ansible_network_os=splunk.enterprise_security.splunk
{% endif %}
{% endfor %}
{% endif %}
{% if security_console == 'qradar' %}
{% for vm in qradar_node_facts.instances %}
{% if 'student' + item == vm.tags.Student %}
qradar ansible_host={{ vm.public_ip_address }} ansible_user=admin private_ip={{ hostvars[vm.tags.Name]['private_ip'] }} ansible_httpapi_pass="Ansible1!" ansible_connection=httpapi ansible_httpapi_use_ssl=yes ansible_httpapi_validate_certs=False ansible_network_os=ibm.qradar.qradar
{% endif %}
{% endfor %}
{% endif %}

[ids]
{% for vm in snort_node_facts.instances %}
{% if 'student' + item == vm.tags.Student %}
snort ansible_host={{ vm.public_ip_address }} ansible_user={{ vm.tags.username }} private_ip={{ hostvars[vm.tags.Name]['private_ip'] }} private_ip2={{ hostvars[vm.tags.Name]['private_ip2'] }}
{% endif %}
{% endfor %}

[firewall]
{% for vm in checkpoint_node_facts.instances %}
{% if 'student' + item == vm.tags.Student %}
checkpoint ansible_host={{ vm.public_ip_address }} ansible_user={{ vm.tags.username }} ansible_password=admin123 private_ip={{ hostvars[vm.tags.Name]['private_ip'] }} ansible_network_os=checkpoint ansible_connection=httpapi ansible_httpapi_use_ssl=yes ansible_httpapi_validate_certs=no
{% endif %}
{% endfor %}

[windows]
{% for vm in windows_node_facts.instances %}
{% if 'student' + item == vm.tags.Student %}
windows-ws ansible_host={{ vm.public_ip_address }} ansible_user={{ vm.tags.username }} ansible_pass={{ windows_password}} ansible_port=5986 ansible_connection=winrm ansible_winrm_server_cert_validation=ignore private_ip={{ hostvars[vm.tags.Name]['private_ip'] }}
{% endif %}
{% endfor %}
